package com.turing.post.organization.util;

import java.io.Serializable;
import java.math.BigInteger;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * 凭证入库单明细
 * 
 * @author wzd
 * 
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "VOUCHERINSTOCKORDERDETAIL")
@IdClass(VoucherInStockOrderDetail.class)
public class VoucherInStockOrderDetail implements Serializable {
	/**
	 * 入库单ID
	 */
	private BigInteger voucherInStockOrderId;
	/**
	 * 顺序号
	 */
	private BigInteger seqNo;
	/**
	 * 凭证种类ID
	 */
	private BigInteger voucherId;
	/**
	 * 起始凭证号
	 */
	private String startVoucherNo;
	/**
	 * 终止凭证号
	 */
	private String endVoucherNo;
	/**
	 * 张数
	 */
	private int count;
	

	public VoucherInStockOrderDetail() {

	}

	@Id
	@Column(name = "voucherInStockOrderId", nullable = false)
	public BigInteger getVoucherInStockOrderId() {
		return voucherInStockOrderId;
	}

	public void setVoucherInStockOrderId(BigInteger voucherInStockOrderId) {
		this.voucherInStockOrderId = voucherInStockOrderId;
	}
	@Id
	@Column(name = "seqNo", nullable = false)
	public BigInteger getSeqNo() {
		return seqNo;
	}

	public void setSeqNo(BigInteger seqNo) {
		this.seqNo = seqNo;
	}
	@Id
	@Column(name = "voucherId", nullable = false)
	public BigInteger getVoucherId() {
		return voucherId;
	}

	public void setVoucherId(BigInteger voucherId) {
		this.voucherId = voucherId;
	}
	@Column(name = "startVoucherNo", nullable = false)
	public String getStartVoucherNo() {
		return startVoucherNo;
	}

	public void setStartVoucherNo(String startVoucherNo) {
		this.startVoucherNo = startVoucherNo;
	}
	@Column(name = "endVoucherNo", nullable = false)
	public String getEndVoucherNo() {
		return endVoucherNo;
	}

	public void setEndVoucherNo(String endVoucherNo) {
		this.endVoucherNo = endVoucherNo;
	}
	@Column(name = "count", nullable = false)
	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}
 
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime* result
				+ ((getVoucherInStockOrderId() == null) ? 0 : getVoucherInStockOrderId().hashCode());
		result = prime * result
				+ ((getVoucherId() == null) ? 0 : getVoucherId().hashCode());
		result = prime * result
		        + ((getSeqNo() == null) ? 0 : getSeqNo().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final VoucherInStockOrderDetail other = (VoucherInStockOrderDetail) obj;
		if (getVoucherInStockOrderId() == null) {
			if (other.getVoucherInStockOrderId() != null)
				return false;
		} else if (!getVoucherInStockOrderId().equals(other.getVoucherInStockOrderId()))
			return false;
		if (getVoucherId() == null) {
			if (other.getVoucherId() != null)
				return false;
		} else if (!getVoucherId().equals(other.getVoucherId()))
			return false;
		if (getSeqNo() == null) {
			if (other.getSeqNo() != null)
				return false;
		} else if (!getSeqNo().equals(other.getSeqNo()))
			return false;
		return true;
	}

	
}